package com.jt.www.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jt.www.domain.enums.common.AuditStatusEnum;
import com.jt.www.domain.enums.common.PushStatusEnum;
import com.jt.www.domain.enums.pc.OfflineTypeEnum;
import com.jt.www.domain.vo.OfflineOrderVo;
import com.jt.www.util.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;

/**
 * 线下录入保存
 * Created by shaoyn on 2020/05/22.
 */
public class OfflineOrderOutputDTO {

    @ApiModelProperty(value = "线下业务类别 00:统保示范项目  01:教育区域统保业务  02:教育延伸业务  03:教育衍生业务  04:其他教育保险业务")
    private String offlineType;

    @ApiModelProperty(value = "业务归属-分公司编码")
    private String branchCode;

    @ApiModelProperty(value = "业务归属-分公司名称")
    private String branchName;

    @ApiModelProperty(value = "出单公司名称")
    private String insCompanyName;

    @ApiModelProperty(value = "产品编号")
    private String productCode;

    @ApiModelProperty(value = "产品名称")
    private String productName;

    @ApiModelProperty(value = "保单号")
    private String policyNo;

    @ApiModelProperty(value = "客户名称")
    private String customerName;

    @ApiModelProperty(value = "投保人名称")
    private String holderName;

    @ApiModelProperty(value = "被保人名称")
    private String insuredName;

    @ApiModelProperty(value = "保险起期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String startDate;

    @ApiModelProperty(value = "保险止期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String endDate;

    @ApiModelProperty(value = "录单日期(出单)")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String insureDate;

    @ApiModelProperty(value = "保单保费")
    private BigDecimal premium;

    @ApiModelProperty(value = "推送状态")
    private String pushStatus;

    @ApiModelProperty(value = "失败原因")
    private String errorMsg;

    @ApiModelProperty(value = "录入审核状态 1：待审核 2：审核退回  3：审核通过")
    private String auditStatus;

    @ApiModelProperty(value = "审核说明")
    private String auditOpinion;

    @ApiModelProperty(value = "操作人名称")
    private String operatorName;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String createTime;

    @ApiModelProperty(value = "录单时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String inputTime;

    @ApiModelProperty(value = "线下业务类别 00:统保示范项目  01:教育区域统保业务  02:教育延伸业务  03:教育衍生业务  04:其他教育保险业务")
    private String offlineTypeDesc;

    @ApiModelProperty(value = "推送状态")
    private String pushStatusDesc;

    @ApiModelProperty(value = "录入审核状态 1：待审核 2：审核退回  3：审核通过")
    private String auditStatusDesc;

    @ApiModelProperty(value = "计算佣金的营销人员姓名")
    private String marketerName;

    public OfflineOrderOutputDTO(OfflineOrderVo offlineOrderVo) {
        this.offlineType = offlineOrderVo.getOfflineType();
        this.branchCode = offlineOrderVo.getBranchCode();
        this.branchName = offlineOrderVo.getBranchName();
        this.insCompanyName = offlineOrderVo.getInsCompanyName();
        this.productCode = offlineOrderVo.getProductCode();
        this.productName = offlineOrderVo.getProductName();
        this.policyNo = offlineOrderVo.getPolicyNo();
        this.customerName = offlineOrderVo.getCustomerName();
        this.holderName = offlineOrderVo.getHolderName();
        this.insuredName = offlineOrderVo.getInsuredName();
        this.insCompanyName = offlineOrderVo.getInsCompanyName();
        if (null != offlineOrderVo.getStartDate()) {
            this.startDate = DateUtils.converDate(offlineOrderVo.getStartDate());
        }
        if (null != offlineOrderVo.getEndDate()) {
            this.endDate = DateUtils.converDate(offlineOrderVo.getEndDate());
        }
        if (null != offlineOrderVo.getInsureDate()) {
            this.insureDate = DateUtils.converDate(offlineOrderVo.getInsureDate());
        }

        if (null != offlineOrderVo.getInputTime()) {
            this.inputTime = DateUtils.converDate(offlineOrderVo.getInputTime());
        }
        this.premium = offlineOrderVo.getPremium();
        this.pushStatus = offlineOrderVo.getPushStatus();
        this.errorMsg = offlineOrderVo.getErrorMsg();
        this.auditStatus = offlineOrderVo.getAuditStatus();
        this.auditOpinion = offlineOrderVo.getAuditOpinion();
        this.operatorName = offlineOrderVo.getOperatorName();

        if (null != offlineOrderVo.getCreateTime()) {
            this.createTime = DateUtils.converDate(offlineOrderVo.getCreateTime());
        }
        this.offlineTypeDesc = OfflineTypeEnum.getDescByType(offlineOrderVo.getOfflineType());
        this.pushStatusDesc = PushStatusEnum.getDescByCode(offlineOrderVo.getPushStatus());
        this.auditStatusDesc = AuditStatusEnum.getDescByCode(offlineOrderVo.getAuditStatus());
        this.marketerName = offlineOrderVo.getMarketerName();
    }

    public String getOfflineType() {
        return offlineType;
    }

    public void setOfflineType(String offlineType) {
        this.offlineType = offlineType;
    }

    public String getBranchCode() {
        return branchCode;
    }

    public void setBranchCode(String branchCode) {
        this.branchCode = branchCode;
    }

    public String getBranchName() {
        return branchName;
    }

    public void setBranchName(String branchName) {
        this.branchName = branchName;
    }

    public String getInsCompanyName() {
        return insCompanyName;
    }

    public void setInsCompanyName(String insCompanyName) {
        this.insCompanyName = insCompanyName;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getPolicyNo() {
        return policyNo;
    }

    public void setPolicyNo(String policyNo) {
        this.policyNo = policyNo;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getHolderName() {
        return holderName;
    }

    public void setHolderName(String holderName) {
        this.holderName = holderName;
    }

    public String getInsuredName() {
        return insuredName;
    }

    public void setInsuredName(String insuredName) {
        this.insuredName = insuredName;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getInsureDate() {
        return insureDate;
    }

    public void setInsureDate(String insureDate) {
        this.insureDate = insureDate;
    }

    public BigDecimal getPremium() {
        return premium;
    }

    public void setPremium(BigDecimal premium) {
        this.premium = premium;
    }

    public String getPushStatus() {
        return pushStatus;
    }

    public void setPushStatus(String pushStatus) {
        this.pushStatus = pushStatus;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    public String getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(String auditStatus) {
        this.auditStatus = auditStatus;
    }

    public String getAuditOpinion() {
        return auditOpinion;
    }

    public void setAuditOpinion(String auditOpinion) {
        this.auditOpinion = auditOpinion;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getInputTime() {
        return inputTime;
    }

    public void setInputTime(String inputTime) {
        this.inputTime = inputTime;
    }

    public String getOfflineTypeDesc() {
        return offlineTypeDesc;
    }

    public void setOfflineTypeDesc(String offlineTypeDesc) {
        this.offlineTypeDesc = offlineTypeDesc;
    }

    public String getPushStatusDesc() {
        return pushStatusDesc;
    }

    public void setPushStatusDesc(String pushStatusDesc) {
        this.pushStatusDesc = pushStatusDesc;
    }

    public String getAuditStatusDesc() {
        return auditStatusDesc;
    }

    public void setAuditStatusDesc(String auditStatusDesc) {
        this.auditStatusDesc = auditStatusDesc;
    }

    public String getMarketerName() {
        return marketerName;
    }

    public void setMarketerName(String marketerName) {
        this.marketerName = marketerName;
    }
}
